Skip to content

rework file stat handling to simplify and cross-platform-ability#570

Merged
funny-falcon merged 2 commits into
REL_2_6from
REL_2_6_rework_stat
Nov 16, 2022
Merged

rework file stat handling to simplify and cross-platform-ability#570
funny-falcon merged 2 commits into
REL_2_6from
REL_2_6_rework_stat

Conversation

@funny-falcon

Copy link
Copy Markdown
Contributor
  • don't use full struct stat since it differs between platforms
  • store file kind separately from mode in pb specific way
  • add pioFilesAreSame as replacement of fio_is_same_file since it needs st_ino and st_dev, therefore had to run on localdrive always.

Comment thread src/utils/file.h
PIO_KIND_FIFO = 4,
PIO_KIND_SOCK = 5,
PIO_KIND_CHARDEV = 6,
PIO_KIND_BLOCKDEV = 7,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

запятая в последнем элементе enum - это C99? документация postgres говорит - "at least C89-compliant".

Comment thread src/archive.c Outdated
struct stat st;
pio_stat_t st;
int partial_try_count = 0;
ssize_t partial_file_size = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial_file_size тоже должен стать беззнаковым

Comment thread src/validate.c
pthread_t *threads;
validate_files_arg *threads_args;
int i;
err_i err;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно ли сюда FOBJ_FUNC_ARP или того, который в main достаточно?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В принципе, достаточно, т.к. если будет ошибка, то мы вывалимся.

…ability

- don't use full `struct stat` since it differs between platforms
- store file kind separately from mode in pb specific way
- add pioFilesAreSame as replacement of fio_is_same_file since it needs
  st_ino and st_dev, therefore had to run on localdrive always.
@funny-falcon funny-falcon merged commit d78283c into REL_2_6 Nov 16, 2022
@Burus Burus added this to the 2.6.0 milestone Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants